a755b7746a30adcec18d89d34faa7a030ac57da5,opennms-services/src/main/java/org/opennms/netmgt/snmpinterfacepoller/pollable/PollableSnmpInterface.java,PollableSnmpInterface,doPoll,#SnmpPollInterfaceMonitor#List#,195

Before Change


                    
                    // first run send all down events if suppressAdminDownEvent is false otherwise
                    // send all down events only for interface whose admin status is up
                    if (suppressAdminDownEvent()) {
                        if (firstrun && miface.getAdminstatus() == SnmpMinimalPollInterface.IF_UP && miface.getOperstatus() == SnmpMinimalPollInterface.IF_DOWN)
                    		sendOperDownEvent(iface);
                    } else {
                        if (firstrun && miface.getAdminstatus() == SnmpMinimalPollInterface.IF_DOWN) sendAdminDownEvent(iface);
                        if (firstrun && miface.getOperstatus() == SnmpMinimalPollInterface.IF_DOWN) sendOperDownEvent(iface);
                    }
                    // OperStatus management
                    if (iface.getIfOperStatus() != miface.getOperstatus()) {
                        changed = true;
                        iface.setIfOperStatus(new Integer(miface.getOperstatus()));
                        if (!firstrun) {
                            if (miface.getOperstatus() == SnmpMinimalPollInterface.IF_DOWN) {
                                sendOperDownEvent(iface);
                            }   
                            if (miface.getOperstatus() == SnmpMinimalPollInterface.IF_UP) {
                                sendOperUpEvent(iface);
                            }   
                        }

After Change


                    log().debug("Previuos status Admin/Oper: " + iface.getIfAdminStatus() + "/" + iface.getIfOperStatus());
                    log().debug("Current status Admin/Oper: " + miface.getAdminstatus() + "/" + miface.getOperstatus());
                    
                    if (firstrun) {
                        // If the interface is Admin Up, and the interface is Operational Down, we generate an alarm
                        // if no alarm exist in alarm table.
                        if ( miface.getAdminstatus() == SnmpMinimalPollInterface.IF_UP
                          && miface.getOperstatus() == SnmpMinimalPollInterface.IF_DOWN 
                          && !hasOperDownAlarm(miface.getIfindex())) {
                                sendOperDownEvent(iface);
                        } 
                        
                        // If the interface is Admin Up, and the interface is Operational Up, we generate a clean alarm
                        // if exist an alarm in alarm table
                        if ( miface.getAdminstatus() == SnmpMinimalPollInterface.IF_UP
                                && miface.getOperstatus() == SnmpMinimalPollInterface.IF_UP 
                                && hasOperDownAlarm(miface.getIfindex())) {
                                      sendOperUpEvent(iface);
                        } 
                        
                        
                        if (!suppressAdminDownEvent() && miface.getAdminstatus() == SnmpMinimalPollInterface.IF_DOWN 
                                && ! hasAdminDownAlarm(miface.getIfindex())) {
                                sendAdminDownEvent(iface);
                        }

                        if (!suppressAdminDownEvent() && miface.getAdminstatus() == SnmpMinimalPollInterface.IF_UP 
                                && hasAdminDownAlarm(miface.getIfindex())) {
                                sendAdminUpEvent(iface);
                        }

                    } // end firstrun
                    
                    if (iface.getIfAdminStatus() != miface.getAdminstatus()) {
                        changed = true;
                        iface.setIfAdminStatus(new Integer(miface.getAdminstatus()));
                        // We create event if and only if status changes from first run
                        // and suppressAdminDownEvent is false
                        if (!firstrun && !suppressAdminDownEvent()) {
                            if (miface.getAdminstatus() == SnmpMinimalPollInterface.IF_DOWN)
                                sendAdminDownEvent(iface);
                            if (miface.getAdminstatus() == SnmpMinimalPollInterface.IF_UP)
                                sendAdminUpEvent(iface);
                        }
                    }
                                        
                    if (iface.getIfOperStatus() != miface.getOperstatus()) {
                        changed = true;
                        iface.setIfOperStatus(new Integer(miface.getOperstatus()));
                        // We create event if and only if status changes from first run
                        // and the interface is administratevely up
                        if (!firstrun && (miface.getAdminstatus() == SnmpMinimalPollInterface.IF_UP)) {
                            if (miface.getOperstatus() == SnmpMinimalPollInterface.IF_DOWN)
                                sendOperDownEvent(iface);
                            if (miface.getOperstatus() == SnmpMinimalPollInterface.IF_UP)
                                sendOperUpEvent(iface);
                        }
                    }